Repository navigation
fix(runtime): a recursive run is a named MapLogicError, not a SystemStackError - #875
Merged
Merged
Conversation
…tackError A self-recursive `run stage.<self>` (or a mutual run cycle across stages) recursed until SystemStackError - a crash-class death embedders cannot handle (maps#294, 15 fuzz cases; rs aborted the process outright pre-0.3.3, ts overflows its stack the same way). The run chain is threaded through nested stages and a revisited RESOLVED target (document + stage, not the alias spelling) is a named MapLogicError carrying the chain, in the directive's own syntax - mirroring rs's shipped 0.3.3 guard and the W1 `use cycle:` named errors. py's conversion-time guard fires earlier still. A non-cyclic diamond (two callers sharing one downstream run) still works - pinned alongside the self and mutual cycle repros. Part of interscript/maps#294 (the ts leg lands separately).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
maps#294 leg for the ruby runtime: a self-recursive
run stage.<self>(or a mutual run cycle across stages) recursed untilSystemStackError: stack level too deep— a crash-class death embedders cannot meaningfully handle (the fuzz campaign caught 15 such cases; rs aborted the process outright pre-0.3.3, and ts overflows its stack the same way — its leg lands separately).The fix threads the run chain through nested stage execution:
Interpreter#callseeds it with the invoked stage, and everyRunrule extends it for its target. A revisited RESOLVED target (document + stage, not the alias spelling — a dependency chain may legitimately reuse one alias name for different targets) raises a namedInterscript::MapLogicErrorcarrying the chain, in the directive's own syntax:This mirrors rs's shipped 0.3.3 guard (
iscrs:map logic error: run cycle: …— verified byte-identical chain text through the maps fuzz driver) and the W1use cycle:named errors. py's conversion-time guard (its 0.2.x engine inlines stages, so it cannot recurse) fires earlier still; the contract admits any fire point up to execution, never a crash.A NON-cyclic re-run stays legal: the chain holds only stages in flight, and the entry is popped when the target completes. The diamond pin (main runs a and b; both run common) proves shared downstream runs keep working.
Contract (maps#294)
run cycle: <chain>with the chain joined->; entries aremap.<document>.stage.<stage>keyed by resolved target. Class: MapLogicError family everywhere.Test plan
spec/interscript/isc/run_cycle_spec.rb+ three fixtures (self-run, mutual-run, diamond-run): both cycle rows red before the fix (SystemStackError), green after with/run cycle/; diamond green before and after.SKIP_JS=1 SKIP_PYTHON=1 bundle exec rake— 443 examples, 0 failures, 11 pending (env-gated ML fixtures, pre-existing) — identical skip flags to CI's rake.yml.bundle exec standardrbclean on both touched files.Part of interscript/maps#294 (the ts leg lands separately; the maps issue closes when the last runtime lands).